From: Stefan Monnier Date: Wed, 30 Mar 2011 18:04:11 +0000 (-0400) Subject: * src/bytecode.c (Fbyte_code): CAR and CDR can GC. X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1^2~5^2~844^2~2044 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=1c470562971bd86b1767ceb9ae95ece71228549f;p=emacs.git * src/bytecode.c (Fbyte_code): CAR and CDR can GC. --- diff --git a/src/ChangeLog b/src/ChangeLog index 2df49ff31bc..0b0ed2ed775 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2011-03-30 Stefan Monnier + + * bytecode.c (Fbyte_code): CAR and CDR can GC. + 2011-03-30 Zachary Kanfer (tiny change) * keyboard.c (Fexecute_extended_command): Do log the "suggest key diff --git a/src/bytecode.c b/src/bytecode.c index ce2f06dfccb..a7be8e26f27 100644 --- a/src/bytecode.c +++ b/src/bytecode.c @@ -554,7 +554,16 @@ If the third argument is incorrect, Emacs may crash. */) { Lisp_Object v1; v1 = TOP; - TOP = CAR (v1); + if (CONSP (v1)) + TOP = XCAR (v1); + else if (NILP (v1)) + TOP = Qnil; + else + { + BEFORE_POTENTIAL_GC (); + wrong_type_argument (Qlistp, v1); + AFTER_POTENTIAL_GC (); + } break; } @@ -580,7 +589,17 @@ If the third argument is incorrect, Emacs may crash. */) { Lisp_Object v1; v1 = TOP; - TOP = CDR (v1); + if (CONSP (v1)) + TOP = XCDR (v1); + else if (NILP (v1)) + TOP = Qnil; + else + { + BEFORE_POTENTIAL_GC (); + wrong_type_argument (Qlistp, v1); + AFTER_POTENTIAL_GC (); + } + break; break; } @@ -911,13 +930,13 @@ If the third argument is incorrect, Emacs may crash. */) v1 = POP; v2 = TOP; CHECK_NUMBER (v2); - AFTER_POTENTIAL_GC (); op = XINT (v2); immediate_quit = 1; while (--op >= 0 && CONSP (v1)) v1 = XCDR (v1); immediate_quit = 0; TOP = CAR (v1); + AFTER_POTENTIAL_GC (); break; }